POV-Ray : Newsgroups : povray.general : orthographic projection of game tiles.... : Re: orthographic projection of game tiles.... Server Time
12 Aug 2024 09:23:16 EDT (-0400)
  Re: orthographic projection of game tiles....  
From: John M  Dlugosz
Date: 1 Mar 1999 23:22:09
Message: <36db6771.0@news.povray.org>
Stephen Guentert wrote in message <36db57d4.0@news.povray.org>...
>I messed with the up and right vectors and got it to work perfectly.
>I didn't use all those #declares and #locals though.

Why not?  makes it easier to change, and you don't have magic numbers in the
final code but see the reasons for them.

> notice also that my right vector is the square root of
>2 (scaled by 10).  my up vector is 1.63 (scaled again).
>this gives me exactly what I want - but I'd like to understand the
>mathematical significance of these numbers.

Well root-two is the diagonal of a square, and 1.618123 (close to what you
have) is the inverse of the "golden ratio", a way to divide a line so that
the ratio the small piece to the large is the same as the ratio of the large
to the whole.

>camera {  //  Camera StdCam
>orthographic
>  location  <10 , 10, 10 >
>  right     <0  , 1.4142135623730950488016887242097 * 10 , 0.0 >
>  up        <1.63 * 10, 0.0 , 0.0 >
>  direction <0  , 0 , 1 >
>  look_at   <0.000, 0.000, 0.000>
>  scale 10.0
>}
>


In a ortho camera, the "right" is the number of POV units wide the scene
will render, and the "up" is the number of POV units tall.  So you're saying
you want 14.1 x 16.3 POV units to form your image, outputting in 512x512
pixels.  Strange that your pixels are not square...

You are located at 10,10,10, but looking down over your left sholder.  The
angle of this view to the ground probably is the cause of these numbers.

Normally, in an ortho projection, the "look at" should be directly down the
line of sight, so it has two numbers the same as the location, and the one
that's different is the one that's not used in the up and right.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.